package com.basic.technology.study.introduction.thread.multi_thread.prctice;

public class Test2 {

    //private Object obj = new Object();

    public static void main(String[] args) throws InterruptedException {


        Thread t1 = new Thread() {
            @Override
            public void run() {
                try {
                    Thread.sleep(5000);
                    System.out.println("wait");
                } catch (InterruptedException e) {
                    System.out.println("interrupt");
                }

            }
        };
        t1.start();

        Thread.sleep(2);
        System.out.println("main");
        t1.interrupt();


    }
}
